package ug.co.icom.kyazze.healthticket.data;


import ug.co.icom.kyazze.healthticket.R;
import android.app.Activity;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class CustomListConnectionsAdapter extends ArrayAdapter<String> {
	private final Activity context;
	private final String[] web;
	@SuppressWarnings("unused")
	private final Uri[] imageId;
	
	public CustomListConnectionsAdapter(Activity context, String[] web, Uri[] imageId) {
		super(context, R.layout.connections_list_item, web);
		this.context = context;
		this.web = web;
		this.imageId = imageId;

	}
	
	@Override
	public View getView(int position, View view, ViewGroup parent) {
		LayoutInflater inflater = context.getLayoutInflater();
		View rowView= inflater.inflate(R.layout.connections_list_item, null, true);
		TextView txtTitle = (TextView) rowView.findViewById(R.id.connections_text);
		@SuppressWarnings("unused")
		ImageView conn_image = (ImageView) rowView.findViewById(R.id.connections_image);

		
		//ImageView imageView = (ImageView) rowView.findViewById(R.id.img);
		txtTitle.setText(web[position]);
		//conn_image.setImageURI(imageId[position]);
		//int start_val = position+1;
		//number.setText(""+start_val);

		//imageView.setImageResource(imageId[position]);
		return rowView;
	}

}
